var __defProp = Object.defineProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
import { defineComponent, ref, computed, onMounted, h, watch, nextTick, onBeforeUnmount, resolveComponent, createElementBlock, openBlock, createElementVNode, createCommentVNode, withModifiers, toDisplayString, normalizeStyle, createVNode, withDirectives, Fragment, renderList, createBlock, vShow, resolveDirective, normalizeClass, withCtx, mergeProps, mergeModels, useModel, createTextVNode, unref, onActivated, onUnmounted, getCurrentInstance, createApp } from "vue";
import ElementPlus, { ElIcon, ElSelect, ElOption, ElInput, ElScrollbar, ElTree, ElMessage } from "element-plus";
import { CircleClose, CircleCheck, Plus, Minus } from "@element-plus/icons-vue";
import { defineStore } from "pinia";
import * as echarts from "echarts";
import { useRoute } from "vue-router";
import Split from "split.js";
const _sfc_main$6$1 = defineComponent({
  name: "NodeValue",
  props: {
    data: {
      type: Object,
      required: true
    },
    readonly: {
      type: Boolean,
      required: true
    }
  },
  setup(props, context) {
    const isHasFocus = ref(false);
    const validText = ref("");
    const checkText = ref("");
    const validTypeArr = ["Integer", "BitString", "NumericString", "Ia5string", "OctetString", "String"];
    const otherProps = computed(() => {
      return props.data.bitArray ? props.data.bitArray.map((x) => x ? 1 : 0).join("") : "";
    });
    const formValid = (data) => {
      if (data.isRequired && data.value === "") {
        validText.value = "字段必填";
        return;
      }
      if (data.controlType === "Integer") {
        const { minInclusive, maxInclusive, value } = data;
        if (!minInclusive && !maxInclusive) {
          checkText.value = validText.value = "";
          return;
        }
        if (Number(value) < minInclusive) {
          validText.value = `最小值为${minInclusive}`;
          return;
        }
        if (Number(value) > maxInclusive) {
          validText.value = `最大值为${maxInclusive}`;
          return;
        }
      } else if (data.controlType === "BitString") {
        const { Length } = data;
        checkText.value = `长度为${Length}的二进制数`;
        if (otherProps.value.length !== Length) {
          validText.value = `长度应为${Length}`;
          return;
        }
      }
      validText.value = "";
    };
    const updateEmit = () => {
      if (validText.value === "") {
        context.emit("updateForm", props.data);
      }
    };
    const publicEvent = {
      onfocus: () => {
        isHasFocus.value = true;
      },
      onblur: () => {
        isHasFocus.value = false;
      }
    };
    onMounted(() => {
    });
    const strategy = {
      Integer: (data) => {
        const { value, isReadOnly: disabled } = data;
        return h(ElInput, {
          class: ["int-input", "el-input"],
          // 保持原有类名 + 组件基础类
          modelValue: value,
          // 双向绑定值
          readonly: props.readonly,
          disabled,
          "onUpdate:modelValue": (val) => {
            data.value = val;
            formValid(data);
          },
          onChange: (val) => {
            if (!value) return;
            data.value = parseFloat(val);
            updateEmit();
          },
          ...publicEvent
        });
      },
      Ia5string: (data) => {
        const { value, minLength, isReadOnly: disabled } = data;
        return h(ElInput, {
          class: ["int-input", "el-input"],
          // 保持原有类名 + 组件基础类
          modelValue: value,
          // 双向绑定值
          readonly: props.readonly,
          "onUpdate:modelValue": (val) => {
            data.value = val;
            formValid(data);
          },
          onChange: () => {
            updateEmit();
          },
          ...publicEvent
        });
      },
      String: (data) => {
        const { value, minLength, isReadOnly: disabled } = data;
        return h(ElInput, {
          class: ["int-input", "el-input"],
          // 保持原有类名 + 组件基础类
          modelValue: value,
          // 双向绑定值
          readonly: props.readonly,
          "onUpdate:modelValue": (val) => {
            data.value = val;
            formValid(data);
          },
          onChange: () => {
            updateEmit();
          },
          ...publicEvent
        });
      },
      OctetString: (data) => {
        const { value, minLength, isReadOnly: disabled } = data;
        return h(ElInput, {
          class: ["int-input", "el-input"],
          modelValue: value,
          // 双向绑定值
          readonly: props.readonly,
          attrs: { minlength: minLength, readonly: props.readonly },
          "onUpdate:modelValue": (val) => {
            data.value = val;
            formValid(data);
          },
          onChange: (val) => {
            const is16Hex = /^[\-A-Fa-f0-9\s]*$/.test(val);
            if (is16Hex) {
              const newValue = value !== "" ? String(value).replace(/\s+/g, "").match(new RegExp("[^\\n]{1,2}", "g")).join(" ") : "";
              data.value = newValue;
              formValid(data);
              updateEmit();
            }
          }
        });
      },
      // NumericString: (data: nodeItem) => {
      //   const { Value: value, MinLength, IsReadOnly: disabled } = data;
      //   return h("el-input", {
      //     class: "int-input",
      //     props: { value, disabled },
      //     attrs: { minlength: MinLength, readonly: props.readonly },
      //     on: {
      //       input: (value: string) => {
      //         const isNumber = /^[\.\-0-9]*$/.test(value);
      //         if (isNumber) {
      //           data.Value = value;
      //           formValid(data);
      //         }
      //       },
      //       ...publicEvent,
      //     },
      //   });
      // },
      // BitString: (data: nodeItem) => {
      //   const { IsReadOnly: disabled } = data;
      //   const { value } = otherProps;
      //   return h("el-input", {
      //     class: "int-input",
      //     props: { otherProps.value.value, disabled },
      //     attrs: { readonly: props.readonly },
      //     on: {
      //       input: (value: string) => {
      //         const isBinary = /^[0|1]*$/.test(value);
      //         if (isBinary) {
      //           data.OtherProps = value;
      //           formValid(data);
      //         }
      //       },
      //       change: (value: string) => {
      //         data.BitArray = value.split("").map(x => !!Number(x));
      //       },
      //       ...publicEvent,
      //     },
      //   });
      // },
      Enum: (data) => {
        const { value, constraint, isReadOnly: disabled } = data;
        const options = [];
        constraint == null ? void 0 : constraint.forEach((optionValue) => {
          options.push({ label: optionValue, value: optionValue });
        });
        return h(
          ElSelect,
          {
            class: "custom-el-select",
            // 添加自定义类名
            modelValue: data.value,
            "onUpdate:modelValue": (val) => {
              data.value = val;
            },
            onChange: () => {
              updateEmit();
            },
            size: "small"
          },
          [
            ...options.map(
              (option) => h(ElOption, {
                key: option.value,
                label: option.label,
                value: option.value
              })
            )
          ]
        );
      },
      // Choice: (data: nodeItem) => {
      //   const { Value: value, Constraint, IsReadOnly: disabled } = data;
      //   const optionsArr = Constraint.map(value => {
      //     if (typeof value === "string") return;
      //     return h("el-option", { props: { label: value.Name, value } });
      //   });
      //   return h(
      //     "el-select",
      //     {
      //       class: "enum-select",
      //       props: { value, valueKey: "Name", placeholder: " ", disabled: disabled || props.readonly },
      //       on: {
      //         input: (value: string) => {
      //           data.Value = value;
      //         },
      //       },
      //     },
      //     [optionsArr],
      //   );
      // },
      Boolean: (data) => {
        const options = [
          { label: "是", value: true },
          { label: "否", value: false }
        ];
        return h(
          ElSelect,
          {
            class: "custom-el-select",
            // 添加自定义类名
            modelValue: data.value,
            "onUpdate:modelValue": (val) => {
              data.value = val;
            },
            onChange: () => {
              updateEmit();
            },
            size: "small"
          },
          [
            ...options.map(
              (option) => h(ElOption, {
                label: option.label,
                value: option.value
              })
            )
          ]
        );
      },
      Sequence: () => {
        return h("div", {}, "");
      },
      SequenceList: (data) => {
        const max = 9999;
        const min = 0;
        const len = data.child && data.child.length;
        const elementName = "成员";
        return h("div", { class: "sequence-list-value" }, [
          h(
            "div",
            {
              class: "btn-icon"
            },
            [
              h(
                ElIcon,
                {
                  class: `el-icon-plus ${len < max ? "" : "gray"}`,
                  onClick: () => {
                    if (len < max) {
                      const addRow = data.elementForm;
                      const count = data.child ? data.child.length + 1 : 1;
                      if (addRow) {
                        addRow.name = `${elementName}(${count})`;
                      }
                      data.child.push(JSON.parse(JSON.stringify(addRow)));
                      updateEmit();
                    }
                  }
                },
                [h(Plus)]
              ),
              h(
                ElIcon,
                {
                  class: `el-icon-minus ${len > min ? "" : "gray"}`,
                  onClick: () => {
                    if (len > min) {
                      data.child.pop();
                      updateEmit();
                    }
                  }
                },
                [h(Minus)]
              )
            ]
          )
          // h("span", { class: "valid-text" }, validText),
        ]);
      },
      // 其他控件类型的渲染逻辑...
      default: (data) => {
        return h("div", {}, `未定义的控件类型: ${data.controlType}`);
      }
    };
    formValid(props.data);
    return () => {
      return h(
        "div",
        {
          class: {
            "node-value": true,
            "node-valid-error": validText.value
          }
        },
        [
          (strategy[props.data.controlType] || strategy.default)(props.data),
          validTypeArr.includes(props.data.controlType) && h("span", { class: "valid-icon" }, [
            [
              validText.value ? h(ElIcon, { color: "red", size: 16 }, [h(CircleClose)]) : isHasFocus.value && !props.readonly && h(ElIcon, { color: "#67c23a", size: 16 }, [h(CircleCheck)])
            ],
            isHasFocus.value && validText.value && h("div", { class: "valid-tips err" }, validText.value),
            !validText.value && !props.readonly && isHasFocus.value && checkText.value && h("div", { class: "valid-tips" }, checkText.value)
          ])
        ]
      );
    };
  }
});
const _export_sfc$1 = (sfc, props) => {
  const target = sfc.__vccOpts || sfc;
  for (const [key, val] of props) {
    target[key] = val;
  }
  return target;
};
const NodeValue = /* @__PURE__ */ _export_sfc$1(_sfc_main$6$1, [["__scopeId", "data-v-8d521ade"]]);
const systolicIcon = '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\r\n<g id="HTSCIT_&#229;&#177;&#149;&#229;&#188;&#128; 2">\r\n<path id="Vector" d="M6.27673 6.28553H17.7233V17.7409H6.27673V6.28553ZM5 5.00881V19H19V5H5V5.00881Z" fill="currentColor"/>\r\n<path id="Vector_2" d="M8 13V11H16V13H8Z" fill="#3a6ef6"/>\r\n</g>\r\n</svg>\r\n';
const expandIcon = '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\r\n<g id="HTSCIT_&#229;&#177;&#149;&#229;&#188;&#128; 1">\r\n<path id="Vector" d="M6.27673 6.28553H17.7233V17.7409H6.27673V6.28553ZM5 5.00881V19H19V5H5V5.00881Z" fill="currentColor"/>\r\n<path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M12.5471 8.1925H11.4528V11.4642H8.18115V12.5585H11.4528V15.8302H12.5471V12.5585H15.8189V11.4642H12.5471V8.1925Z" fill="#3a6ef6"/>\r\n</g>\r\n</svg>\r\n';
const toolIcon = '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\r\n<path d="M13.9498 6C14.8591 6 15.699 6.29966 16.3746 6.80641L15.1183 8.06172L13.892 9.28926L14.7099 10.1078L17.1925 7.62438C17.7138 8.32091 17.997 9.16685 18 10.0369C18.003 10.9069 17.7257 11.7548 17.2093 12.4549C16.6928 13.1551 15.9646 13.6702 15.1325 13.9241C14.3004 14.178 13.4087 14.1571 12.5894 13.8645L8.98345 17.4702C8.82338 17.6359 8.6319 17.7682 8.42019 17.8591C8.20848 17.9501 7.98077 17.9979 7.75036 17.9999C7.51995 18.0019 7.29145 17.958 7.07819 17.8708C6.86493 17.7835 6.67118 17.6546 6.50825 17.4917C6.34532 17.3288 6.21647 17.135 6.12922 16.9217C6.04197 16.7084 5.99806 16.4799 6.00007 16.2495C6.00207 16.019 6.04994 15.7913 6.14088 15.5796C6.23183 15.3678 6.36402 15.1763 6.52976 15.0163L10.1351 11.41C9.9171 10.7988 9.84914 10.1442 9.93696 9.5013C10.0248 8.85838 10.2658 8.24598 10.6397 7.71569C11.0137 7.1854 11.5095 6.75274 12.0856 6.45416C12.6616 6.15558 13.301 5.99982 13.9498 6Z" fill="currentColor"/>\r\n</svg>\r\n';
const _sfc_main$5$1 = defineComponent({
  name: "NodeItem",
  components: {
    NodeValue
  },
  props: {
    data: {
      type: Object,
      required: true
    },
    w: {
      type: Number,
      required: true
    },
    readonly: {
      type: Boolean,
      required: true
    }
  },
  setup(props, { emit }) {
    const isExpand = ref(props.data.isExpand !== false);
    const isChildren = computed(() => {
      return props.data.child && props.data.child.length > 0;
    });
    const handleUpdate = (data) => {
      emit("updateForm", data);
    };
    return {
      isExpand,
      isChildren,
      handleUpdate,
      systolicIcon,
      expandIcon,
      toolIcon
    };
  }
});
const _hoisted_1$3$1 = { class: "node-view" };
const _hoisted_2$3 = { class: "node-item" };
const _hoisted_3$1$1 = { class: "left-item" };
const _hoisted_4$3 = { class: "icon-view" };
const _hoisted_5$2 = ["innerHTML"];
const _hoisted_6$2 = ["innerHTML"];
const _hoisted_7$2 = { class: "label-view" };
const _hoisted_8$2 = {
  key: 0,
  class: "node-children"
};
const _hoisted_9$2 = {
  key: 1,
  class: "node-children"
};
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_NodeValue = resolveComponent("NodeValue");
  const _component_NodeItem = resolveComponent("NodeItem", true);
  return openBlock(), createElementBlock("div", _hoisted_1$3$1, [
    createElementVNode("div", _hoisted_2$3, [
      createElementVNode("div", _hoisted_3$1$1, [
        createElementVNode("div", _hoisted_4$3, [
          _ctx.isChildren ? (openBlock(), createElementBlock("span", {
            key: 0,
            class: "ex-icon force-svg-16",
            innerHTML: _ctx.isExpand ? _ctx.systolicIcon : _ctx.expandIcon,
            onClick: _cache[0] || (_cache[0] = withModifiers(($event) => _ctx.isExpand = !_ctx.isExpand, ["stop"]))
          }, null, 8, _hoisted_5$2)) : (openBlock(), createElementBlock("span", {
            key: 1,
            class: "icon",
            innerHTML: _ctx.toolIcon
          }, null, 8, _hoisted_6$2))
        ]),
        createElementVNode("div", _hoisted_7$2, toDisplayString(_ctx.data.name), 1)
      ]),
      createElementVNode("div", {
        class: "right-item",
        style: normalizeStyle({ width: _ctx.w ? `${_ctx.w / 2}px` : "" })
      }, [
        createVNode(_component_NodeValue, {
          data: _ctx.data,
          readonly: _ctx.readonly,
          onUpdateForm: _ctx.handleUpdate
        }, null, 8, ["data", "readonly", "onUpdateForm"])
      ], 4)
    ]),
    _ctx.isChildren ? (openBlock(), createElementBlock("div", _hoisted_8$2, [
      withDirectives(createElementVNode("div", null, [
        (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.data.child, (x, i) => {
          return openBlock(), createBlock(_component_NodeItem, {
            key: i,
            data: x,
            w: _ctx.w,
            readonly: _ctx.readonly,
            onUpdateForm: _ctx.handleUpdate
          }, null, 8, ["data", "w", "readonly", "onUpdateForm"]);
        }), 128))
      ], 512), [
        [vShow, _ctx.isExpand]
      ])
    ])) : createCommentVNode("", true),
    _ctx.data.controlType === "Choice" && _ctx.data.value ? (openBlock(), createElementBlock("div", _hoisted_9$2, [
      (openBlock(true), createElementBlock(Fragment, null, renderList([_ctx.data.value], (x, i) => {
        return openBlock(), createBlock(_component_NodeItem, {
          key: i,
          data: x,
          w: _ctx.w,
          readonly: _ctx.readonly,
          onUpdateForm: _ctx.handleUpdate
        }, null, 8, ["data", "w", "readonly", "onUpdateForm"]);
      }), 128))
    ])) : createCommentVNode("", true)
  ]);
}
const NodeItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$5$1, [["render", _sfc_render$1], ["__scopeId", "data-v-49690e0a"]]);
const _sfc_main$4$1 = defineComponent({
  name: "NodeTree",
  components: {
    NodeItem
  },
  props: {
    data: {
      type: Array,
      required: true
    },
    isHideHeader: {
      type: Boolean,
      default: false
    },
    readonly: {
      type: Boolean,
      default: false
    },
    isLoading: {
      type: Boolean,
      default: false
    }
  },
  setup(props, { emit }) {
    const treeTbodyW = ref(0);
    const treeTbody = ref(null);
    const scrollbar = ref(null);
    watch(
      () => props.data.length,
      () => {
        nextTick(() => {
          updateTreeTbodyWidth();
        });
      }
    );
    const updateTreeTbodyWidth = () => {
      if (treeTbody.value) {
        treeTbodyW.value = treeTbody.value.offsetWidth;
      }
    };
    const handleResize = () => {
      updateTreeTbodyWidth();
    };
    onMounted(() => {
      window.addEventListener("resize", handleResize);
    });
    onBeforeUnmount(() => {
      window.removeEventListener("resize", handleResize);
    });
    const handleUpdate = (data) => {
      emit("updateForm", data);
    };
    return {
      treeTbodyW,
      treeTbody,
      scrollbar,
      handleUpdate
    };
  }
});
const _hoisted_1$2$1 = { class: "node-content" };
const _hoisted_2$2$1 = { class: "tree-thead" };
const _hoisted_3$3 = {
  ref: "treeTbody",
  class: "tree-tbody"
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_NodeItem = resolveComponent("NodeItem");
  const _component_el_scrollbar = resolveComponent("el-scrollbar");
  const _component_Empty = resolveComponent("Empty");
  const _directive_loading = resolveDirective("loading");
  return withDirectives((openBlock(), createElementBlock("div", _hoisted_1$2$1, [
    withDirectives(createElementVNode("div", _hoisted_2$2$1, [
      _cache[0] || (_cache[0] = createElementVNode("div", { class: "item" }, "名称", -1)),
      createElementVNode("div", {
        class: "item",
        style: normalizeStyle({ width: _ctx.treeTbodyW ? `${_ctx.treeTbodyW / 2}px` : "" })
      }, "值", 4)
    ], 512), [
      [vShow, !_ctx.isHideHeader && _ctx.data.length]
    ]),
    withDirectives(createVNode(_component_el_scrollbar, {
      ref: "scrollbar",
      class: normalizeClass(["tree-scrollbar", _ctx.data.length ? "" : "fill-scroll"])
    }, {
      default: withCtx(() => [
        createElementVNode("div", _hoisted_3$3, [
          (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.data, (x, i) => {
            return openBlock(), createBlock(_component_NodeItem, {
              key: i,
              data: x,
              w: _ctx.treeTbodyW,
              readonly: _ctx.readonly,
              onUpdateForm: _ctx.handleUpdate
            }, null, 8, ["data", "w", "readonly", "onUpdateForm"]);
          }), 128))
        ], 512)
      ]),
      _: 1
    }, 8, ["class"]), [
      [vShow, _ctx.data.length]
    ]),
    withDirectives(createVNode(_component_Empty, { class: "null-box" }, null, 512), [
      [vShow, !_ctx.data.length && !_ctx.isLoading]
    ])
  ])), [
    [_directive_loading, _ctx.isLoading]
  ]);
}
const NodeTree = /* @__PURE__ */ _export_sfc$1(_sfc_main$4$1, [["render", _sfc_render], ["__scopeId", "data-v-344d2e7a"]]);
const _sfc_main$1$1 = /* @__PURE__ */ defineComponent({
  ...{
    name: "TooltipBox"
  },
  __name: "TooltipBox",
  props: {
    content: { default: "" },
    required: { type: Boolean, default: false },
    tooltipAttrs: { default: () => ({
      placement: "top-start",
      openDelay: 0
    }) }
  },
  setup(__props) {
    const isShowTip = ref(false);
    const checkShowTip = (event) => {
      const target = event.currentTarget;
      isShowTip.value = target.clientWidth < target.scrollWidth;
    };
    return (_ctx, _cache) => {
      const _component_el_tooltip = resolveComponent("el-tooltip");
      return openBlock(), createBlock(_component_el_tooltip, mergeProps({
        effect: "dark",
        content: _ctx.content,
        disabled: !isShowTip.value,
        tabindex: -1
      }, _ctx.tooltipAttrs), {
        default: withCtx(() => [
          createElementVNode("div", {
            class: normalizeClass(["name one-line", { required: _ctx.required }]),
            onMouseenter: checkShowTip
          }, toDisplayString(_ctx.content), 35)
        ]),
        _: 1
      }, 16, ["content", "disabled"]);
    };
  }
});
const TooltipBox = /* @__PURE__ */ _export_sfc$1(_sfc_main$1$1, [["__scopeId", "data-v-23efbb0a"]]);
const _hoisted_1$8 = { class: "message" };
const _hoisted_2$4 = { class: "dialog-footer" };
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
  __name: "DialogView",
  props: /* @__PURE__ */ mergeModels({
    config: { default: () => ({}) },
    bizData: { default: null },
    onCallback: { type: Function, default: () => async () => {
    } }
  }, {
    "modelValue": {},
    "modelModifiers": {}
  }),
  emits: /* @__PURE__ */ mergeModels(["Close"], ["update:modelValue"]),
  setup(__props, { emit: __emit }) {
    const dialogVisible = useModel(__props, "modelValue");
    const props = __props;
    const emits = __emit;
    const cancelLoading = ref(false);
    const submitLoading = ref(false);
    const handleCallback = async (bol) => {
      var _a;
      try {
        bol ? submitLoading.value = true : cancelLoading.value = true;
        const params = {
          dialogInfo: isDynamic.value ? props.config : { ...props.config, result: bol },
          // 新增：将通用业务数据传出去
          bizData: props.bizData
        };
        await ((_a = props.onCallback) == null ? void 0 : _a.call(props, params));
        dialogVisible.value = false;
        emits("Close");
      } finally {
        if (bol) {
          submitLoading.value = false;
        } else {
          cancelLoading.value = false;
        }
      }
    };
    const isDynamic = computed(() => {
      return props.config.tipDialogType === "DynamicFormDialog";
    });
    return (_ctx, _cache) => {
      const _component_SvgIcon = resolveComponent("SvgIcon");
      const _component_el_button = resolveComponent("el-button");
      const _component_el_dialog = resolveComponent("el-dialog");
      return openBlock(), createElementBlock("div", null, [
        createVNode(_component_el_dialog, {
          class: normalizeClass({ "dynamic-dialog": isDynamic.value }),
          modelValue: dialogVisible.value,
          "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => dialogVisible.value = $event),
          title: _ctx.config.title,
          width: isDynamic.value ? "860" : "500",
          "show-close": false,
          "close-on-click-modal": false,
          "close-on-press-escape": false,
          "align-center": ""
        }, {
          header: withCtx(() => [
            !isDynamic.value ? (openBlock(), createBlock(_component_SvgIcon, {
              key: 0,
              icon: "warning",
              size: 16
            })) : createCommentVNode("", true),
            createElementVNode("span", null, toDisplayString(_ctx.config.title), 1)
          ]),
          footer: withCtx(() => [
            createElementVNode("div", _hoisted_2$4, [
              _ctx.config.tipDialogType === "QuestionDialog" ? (openBlock(), createBlock(_component_el_button, {
                key: 0,
                onClick: _cache[0] || (_cache[0] = ($event) => handleCallback(false)),
                disabled: cancelLoading.value || submitLoading.value,
                loading: cancelLoading.value
              }, {
                default: withCtx(() => [..._cache[3] || (_cache[3] = [
                  createTextVNode("取消", -1)
                ])]),
                _: 1
              }, 8, ["disabled", "loading"])) : createCommentVNode("", true),
              createVNode(_component_el_button, {
                type: "primary",
                onClick: _cache[1] || (_cache[1] = ($event) => handleCallback(true)),
                disabled: cancelLoading.value || submitLoading.value,
                loading: submitLoading.value
              }, {
                default: withCtx(() => [
                  createTextVNode(toDisplayString(isDynamic.value ? "提交" : "确认"), 1)
                ]),
                _: 1
              }, 8, ["disabled", "loading"])
            ])
          ]),
          default: withCtx(() => [
            createElementVNode("div", _hoisted_1$8, toDisplayString(_ctx.config.message), 1),
            isDynamic.value ? (openBlock(), createBlock(NodeTree, {
              key: 0,
              class: "node-tree",
              data: _ctx.config.result || []
            }, null, 8, ["data"])) : createCommentVNode("", true)
          ]),
          _: 1
        }, 8, ["class", "modelValue", "title", "width"])
      ]);
    };
  }
});
const DialogView = /* @__PURE__ */ _export_sfc$1(_sfc_main$8, [["__scopeId", "data-v-7b66991c"]]);
function createDialog({
  config,
  bizData,
  onCallback
}, deps) {
  console.log("封装后的createDialog1111", config, bizData, onCallback);
  const parentNode = document.createElement("div");
  document.body.appendChild(parentNode);
  const cleanup = () => {
    if (appInstance) {
      appInstance.unmount();
    }
    if (parentNode.parentNode) {
      parentNode.parentNode.removeChild(parentNode);
    }
  };
  let appInstance = null;
  const createAppInstance = () => {
    appInstance = deps.Vue.createApp(DialogView, {
      config,
      bizData,
      onCallback,
      modelValue: true,
      onClose: cleanup
    });
    appInstance.use(deps.ElementPlus);
    appInstance.mount(parentNode);
  };
  createAppInstance();
  return cleanup;
}
const SEND_TEST_CMD_KEY = "send-test-cmd";
const GET_TEST_DATA_KEY = "get-test-data";
const useTestStore = defineStore("testInjection", () => {
  const sendTestCmd = ref(null);
  const updateState = ref(null);
  const setInjections = (injections) => {
    if (injections.sendTestCmd) {
      sendTestCmd.value = injections.sendTestCmd;
    }
    if (injections.updateState) {
      updateState.value = injections.updateState;
    }
  };
  const taskId = ref("");
  const setInitData = (data) => {
    taskId.value = data.taskId;
  };
  return { sendTestCmd, setInjections, setInitData, taskId, updateState };
});
function createCommand(moduleId, fixedParams) {
  return async function(data, params, config = {}) {
    const testStore = useTestStore();
    const sendTestCmd = testStore.sendTestCmd;
    if (!sendTestCmd) {
      throw new Error("sendTestCmd 未在 Pinia 中初始化，请检查插件根组件是否正常挂载");
    }
    const commandPayload = {
      moduleId,
      fixedParams,
      data,
      params: { ...fixedParams, ...params },
      config
    };
    const result = await sendTestCmd("execute", commandPayload);
    return result;
  };
}
const testModuleId = "TestForm";
const openTask = createCommand(testModuleId, { command: "OpenTask" });
const closeTask = createCommand(testModuleId, { command: "CloseTask" });
const startTest = createCommand(testModuleId, { command: "StartTest" });
const pauseTest = createCommand(testModuleId, { command: "PauseTest" });
const resumeTest = createCommand(testModuleId, { command: "ResumeTest" });
const stopTest = createCommand(testModuleId, { command: "StopTest" });
const getTestCaseTrees = createCommand(testModuleId, { command: "GetTestCaseTrees" });
const getTestCaseConfig = createCommand(testModuleId, { command: "GetTestCaseConfig" });
const getTestCaseReults = createCommand(testModuleId, { command: "GetTestCaseReults" });
const getTestLogsByPage = createCommand(testModuleId, { command: "GetTestLogsByPage" });
const updateTestCaseConfig = createCommand(testModuleId, {
  command: "UpdateTestCaseConfig"
});
const updateSkyDirectionAccuracyTestResult = createCommand(testModuleId, {
  command: "UpdateSkyDirectionAccuracyTestResult"
});
const updateGeneratorInfo = createCommand(testModuleId, {
  command: "UpdateGeneratorInfo"
});
const getGroundDirectionAccuracies = createCommand(testModuleId, {
  command: "GetGroundDirectionAccuracies"
});
const updateGroundDirectionAccuracyTestResult = createCommand(testModuleId, {
  command: "UpdateGroundDirectionAccuracyTestResult"
});
const getEnvironment = createCommand(testModuleId, { command: "GetEnvironment" });
const getTestStatisticsInfo = createCommand(testModuleId, { command: "GetTestStatus" });
const dialogCallback = createCommand(testModuleId, { command: "DialogCallback" });
const testStop = '<svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">\r\n<rect x="0.5" y="0.5" width="9" height="9" rx="1" fill="currentColor"/>\r\n</svg>\r\n';
const testPlay = '<svg width="8" height="10" viewBox="0 0 8 10" fill="none" xmlns="http://www.w3.org/2000/svg">\r\n<path d="M1.51759 0.163836C1.37061 0.0659351 1.19977 0.00970589 1.02329 0.00114763C0.846811 -0.00741063 0.671314 0.0320228 0.515525 0.115241C0.359736 0.19846 0.229498 0.322342 0.138706 0.47367C0.0479133 0.624997 -2.64291e-05 0.798093 1.09308e-08 0.974492V9.02551C-2.64291e-05 9.20191 0.0479133 9.375 0.138706 9.52633C0.229498 9.67766 0.359736 9.80154 0.515525 9.88476C0.671314 9.96798 0.846811 10.0074 1.02329 9.99885C1.19977 9.99029 1.37061 9.93407 1.51759 9.83616L7.56549 5.81066C7.69915 5.72167 7.80874 5.60113 7.88454 5.45971C7.96034 5.3183 8 5.16039 8 5C8 4.83961 7.96034 4.6817 7.88454 4.54029C7.80874 4.39887 7.69915 4.27833 7.56549 4.18934L1.51759 0.163836Z" fill="#333333"/>\r\n</svg>\r\n';
const testPause = '<svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">\r\n	<path d="M3.19975 9.27507C3.19975 9.39891 3.06813 9.5 2.90742 9.5H1.15224C0.99153 9.5 0.859619 9.39862 0.859619 9.27507V0.724928C0.859619 0.601088 0.99153 0.5 1.15224 0.5H2.90742C3.06813 0.5 3.20004 0.601376 3.20004 0.724928L3.19975 9.27507ZM9.14038 9.27507C9.14038 9.39891 9.00847 9.5 8.84776 9.5H7.09258C6.93187 9.5 6.79996 9.39862 6.79996 9.27507V0.724928C6.79996 0.601088 6.93187 0.5 7.09258 0.5H8.84776C9.00847 0.5 9.14038 0.601376 9.14038 0.724928V9.27507Z" fill="#333333" />\r\n</svg>\r\n';
const testResume = '<svg width="11" height="10" viewBox="0 0 11 10" fill="none" xmlns="http://www.w3.org/2000/svg">\r\n<path d="M2.22901 0.163836C2.08204 0.0659351 1.91119 0.00970589 1.73472 0.00114763C1.55824 -0.00741063 1.38274 0.0320228 1.22695 0.115241C1.07116 0.19846 0.940924 0.322342 0.850131 0.47367C0.759339 0.624997 0.711399 0.798093 0.711426 0.974492V9.02551C0.711399 9.20191 0.759339 9.375 0.850131 9.52633C0.940924 9.67766 1.07116 9.80154 1.22695 9.88476C1.38274 9.96798 1.55824 10.0074 1.73472 9.99885C1.91119 9.99029 2.08204 9.93407 2.22901 9.83616L8.27691 5.81066C8.41058 5.72168 8.52017 5.60113 8.59597 5.45971C8.67177 5.3183 8.71143 5.16039 8.71143 5C8.71143 4.83961 8.67177 4.6817 8.59597 4.54029C8.52017 4.39887 8.41058 4.27833 8.27691 4.18934L2.22901 0.163836Z" fill="#333333"/>\r\n<rect x="9.61536" width="1.09607" height="10" rx="0.548035" fill="#333333"/>\r\n</svg>\r\n';
const testing = '<?xml version="1.0" encoding="UTF-8"?>\r\n<svg width="26px" height="26px" viewBox="0 0 26 26" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\r\n    <title>编组 11</title>\r\n    <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\r\n        <g id="1111" transform="translate(-27.000000, -453.000000)" fill-rule="nonzero">\r\n            <g id="编组" transform="translate(0.000000, 39.000000)">\r\n                <g id="编组-11" transform="translate(27.000000, 414.000000)">\r\n                    <rect id="矩形" fill="#FFFFFF" opacity="0" x="0" y="0" width="26" height="26"></rect>\r\n                    <path d="M6.5,19.175 L7.90833334,18.7416667 L8.34166666,19.0666667 C8.88333332,19.3916667 9.31666666,19.7166667 9.96666666,20.0416667 L10.5083333,20.2583333 L10.725,21.6666667 L14.4083333,21.6666667 L14.7333333,20.2583333 L15.275,20.0416667 C15.8166667,19.825 16.3583333,19.5 16.9,19.0666667 L17.3333333,18.7416667 L18.7416667,19.175 L20.5833333,15.925 L19.5,14.95 L19.6083333,14.4083333 C19.6083333,14.0833333 19.7166667,13.7583333 19.7166667,13.4333333 C19.7166666,13.1083333 19.7166667,12.7833333 19.6083333,12.4583333 L19.5,12.025 L20.5833333,11.05 L18.7416667,7.8 L17.3333333,8.34166666 L16.9,8.01666666 C16.3583333,7.69166666 15.925,7.36666666 15.275,7.04166666 L14.7333333,6.825 L14.4083333,5.41666666 L10.725,5.41666666 L10.4,6.825 L9.85833334,7.04166666 C9.31666668,7.25833332 8.775,7.58333332 8.34166666,7.90833334 L7.8,8.34166666 L6.5,7.90833334 L4.65833334,11.1583333 L5.74166666,12.1333333 L5.63333334,12.675 C5.63333334,13 5.525,13.325 5.525,13.65 C5.525,13.975 5.525,14.3 5.63333334,14.625 L5.74166666,15.1666667 L4.65833334,16.1416667 L6.5,19.175 Z M4.55,14.625 C4.55,14.3 4.44166666,13.975 4.44166666,13.5416667 C4.44166666,13.1083333 4.44166666,12.7833333 4.55,12.4583333 L3.25,11.2666667 L5.95833334,6.60833334 L7.58333334,7.15 C8.125,6.71666666 8.775,6.39166666 9.425,6.06666666 L9.85833334,4.33333334 L15.275,4.33333334 L15.7083333,6.06666666 C16.3583333,6.39166666 17.0083333,6.71666666 17.55,7.15 L19.175,6.60833334 L21.8833333,11.2666667 L20.5833333,12.4583333 C20.5833333,12.7833333 20.6916667,13.1083333 20.6916667,13.5416667 C20.6916666,13.975 20.6916667,14.3 20.5833333,14.625 L21.8833333,15.8166667 L19.175,20.475 L17.55,19.9333333 C17.0083333,20.3666667 16.3583333,20.6916667 15.7083333,21.0166667 L15.275,22.75 L9.85833334,22.75 L9.425,21.0166667 C8.775,20.6916667 8.125,20.3666667 7.58333334,19.9333333 L5.95833334,20.475 L3.25,15.8166667 L4.55,14.625 Z M12.5666667,16.25 C14.0833333,16.25 15.275,15.0583333 15.275,13.5416667 C15.275,12.025 14.0833333,10.8333333 12.5666667,10.8333333 C11.05,10.8333333 9.85833334,12.025 9.85833334,13.5416667 C9.85833334,15.0583333 11.05,16.25 12.5666667,16.25 Z M8.775,13.5416667 C8.775,11.4833333 10.5083333,9.75 12.5666667,9.75 C14.625,9.75 16.3583333,11.4833333 16.3583333,13.5416667 C16.3583333,15.6 14.625,17.3333333 12.5666667,17.3333333 C10.5083333,17.3333333 8.775,15.6 8.775,13.5416667 Z" id="形状" fill="currentColor"></path>\r\n                </g>\r\n            </g>\r\n        </g>\r\n    </g>\r\n</svg>';
const testFailed = '<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">\r\n<g id="Frame 48">\r\n<path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M14.9246 12.7831L9.58173 4.24045C9.52161 4.15242 9.43799 4.0838 9.34077 4.04273C9.24355 4.00167 9.13682 3.98988 9.03322 4.00876C8.96158 4.02195 8.89324 4.04954 8.83217 4.08992C8.7711 4.1303 8.71853 4.18267 8.67753 4.24397L3.33465 12.7819C3.28342 12.8628 3.25678 12.9572 3.2581 13.0535C3.27767 13.328 3.49811 13.5345 3.76459 13.5345L3.78704 13.5339L14.4676 13.5333C14.6002 13.5398 14.7301 13.4931 14.8295 13.4034C14.9288 13.3136 14.9898 13.1879 14.9994 13.0529L15 13.0236C14.997 12.9379 14.9709 12.8547 14.9246 12.7831ZM13.2843 12.3983H4.97326L9.12934 5.7567L13.2843 12.3983ZM9.05663 10.4269C8.86095 10.4468 8.68482 10.5424 8.56108 10.6973C8.49958 10.773 8.45347 10.8604 8.42541 10.9545C8.39735 11.0485 8.3879 11.1473 8.39762 11.2451L8.42295 11.4909L8.44655 11.4663C8.55072 11.7343 8.80684 11.9214 9.09807 11.9214C9.13318 11.9214 9.16829 11.9197 9.20052 11.9167C9.39431 11.897 9.57253 11.7998 9.69616 11.6465C9.81978 11.4931 9.87874 11.2961 9.86011 11.0985C9.83917 10.9016 9.74327 10.721 9.59302 10.5954C9.44278 10.4698 9.25018 10.4093 9.05663 10.4269ZM8.66701 7.47712C8.70682 7.43764 8.75993 7.41517 8.81547 7.41432H9.4365C9.49172 7.41432 9.5449 7.4356 9.58536 7.4739C9.62582 7.51219 9.65057 7.56467 9.65464 7.62079V9.80924C9.65257 9.86589 9.62917 9.91956 9.5893 9.9591C9.54944 9.99863 9.49616 10.021 9.44053 10.0216H9.43132L8.82181 10.0227H8.81547C8.70382 10.0227 8.60885 9.93183 8.60194 9.81745L8.60137 7.62666C8.60371 7.5701 8.6272 7.5166 8.66701 7.47712Z" fill="#EB5757"/>\r\n</g>\r\n</svg>\r\n';
const testAdopt = '<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">\r\n<g id="&#233;&#128;&#154;&#232;&#191;&#135; (1) 1">\r\n<path id="Vector" d="M8.98874 12.1613L7.86374 13.2863L4.08374 9.50631L4.91624 8.68506L8.98874 12.1613Z" fill="#37BA8B"/>\r\n<path id="Vector_2" d="M7.86377 13.2863L6.73877 12.1613L14.1075 5.4563L14.895 6.25505L7.86377 13.2863V13.2863Z" fill="#37BA8B"/>\r\n</g>\r\n</svg>\r\n';
const folder = '<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">\r\n<path id="Vector" d="M11.4102 3.5952C11.649 3.9348 11.3646 4.35 10.9488 4.35H0.6C0.44087 4.35 0.288258 4.28679 0.175736 4.17426C0.0632141 4.06174 0 3.90913 0 3.75V2.652C0 1.188 1.188 0 2.652 0H4.044C5.022 0 5.328 0.318 5.718 0.84L6.558 1.956C6.744 2.202 6.768 2.232 7.116 2.232H8.79C9.873 2.232 10.8312 2.7702 11.4102 3.5952ZM11.9898 5.8482C11.9893 5.68938 11.9259 5.53723 11.8134 5.4251C11.701 5.31297 11.5486 5.25 11.3898 5.25H0.6C0.44087 5.25 0.288258 5.31321 0.175736 5.42574C0.0632141 5.53826 0 5.69087 0 5.85V8.79C0 10.56 1.44 12 3.21 12H8.79C10.56 12 12 10.56 12 8.79L11.9898 5.8482ZM7.458 8.85H4.458C4.206 8.85 4.008 8.652 4.008 8.4C4.008 8.154 4.206 7.95 4.458 7.95H7.458C7.57735 7.95 7.69181 7.99741 7.7762 8.0818C7.86059 8.16619 7.908 8.28065 7.908 8.4C7.908 8.51935 7.86059 8.63381 7.7762 8.7182C7.69181 8.80259 7.57735 8.85 7.458 8.85Z" fill="#E3AE5D"/>\r\n</svg>\r\n';
const nodeSvg = '<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">\r\n<path id="Vector" d="M10.8837 8.51163V3.48837C11.5479 3.2093 12 2.55628 12 1.81395C12 0.814884 11.1851 0 10.186 0C9.4493 0 8.7907 0.452093 8.51163 1.11628H3.48837C3.2093 0.452093 2.55628 0 1.81395 0C0.814884 0 0 0.814884 0 1.81395C0 2.5507 0.452093 3.2093 1.11628 3.48837V8.51163C0.452093 8.7907 0 9.44372 0 10.186C0 11.1851 0.814884 12 1.81395 12C2.5507 12 3.2093 11.5479 3.48837 10.8837H8.51163C8.7907 11.5479 9.44372 12 10.186 12C11.1851 12 12 11.1851 12 10.186C12 9.4493 11.5479 8.7907 10.8837 8.51163ZM9.99628 8.38326C9.93488 8.38884 9.87907 8.4 9.81767 8.41116C9.66698 8.43907 9.52186 8.4893 9.38233 8.56186C9.34884 8.5786 9.31535 8.59535 9.28186 8.61767C9.00279 8.77395 8.77395 9.00279 8.61767 9.28186C8.59535 9.31535 8.5786 9.34884 8.56186 9.38233C8.4893 9.52186 8.43907 9.66698 8.41116 9.81767C8.4 9.87907 8.38884 9.93488 8.38326 9.99628C8.37768 10.013 8.37768 10.0298 8.37768 10.0465H3.62233C3.61085 9.91013 3.58465 9.7754 3.54419 9.64465C3.53302 9.6 3.51628 9.54977 3.49395 9.50512C3.47721 9.46605 3.46047 9.42698 3.43814 9.38233C3.4214 9.34884 3.40465 9.31535 3.38233 9.28186C3.22605 9.00279 2.99721 8.77395 2.71814 8.61767C2.68465 8.59535 2.65116 8.5786 2.61767 8.56186C2.57302 8.53954 2.53395 8.52279 2.49488 8.50605C2.45023 8.48372 2.4 8.46698 2.35535 8.45581C2.22461 8.41535 2.08987 8.38915 1.95349 8.37768V3.62233C2.0986 3.61116 2.23256 3.58326 2.36651 3.5386C2.41674 3.52744 2.47256 3.50512 2.52279 3.48279C2.5507 3.47163 2.58419 3.45488 2.61767 3.43814C2.65116 3.4214 2.68465 3.40465 2.71814 3.38233C2.99721 3.22605 3.22605 2.99721 3.38233 2.71814C3.40465 2.68465 3.4214 2.65116 3.43814 2.61767C3.45488 2.58419 3.47163 2.5507 3.48279 2.52279C3.50512 2.47256 3.52744 2.41674 3.5386 2.36651C3.58326 2.23256 3.61116 2.0986 3.62233 1.95349H8.37768C8.38884 2.10419 8.41674 2.24372 8.46698 2.38326C8.47814 2.42791 8.49488 2.47814 8.51721 2.52279C8.52837 2.55628 8.54512 2.58419 8.56186 2.61767C8.5786 2.65116 8.59535 2.68465 8.61767 2.71814C8.77395 2.99721 9.00279 3.22605 9.28186 3.38233C9.31535 3.40465 9.34884 3.4214 9.38233 3.43814C9.41581 3.45488 9.44372 3.47163 9.47721 3.48279C9.52186 3.50512 9.57209 3.52186 9.61674 3.53302C9.75628 3.58326 9.89581 3.61116 10.0465 3.62233V8.37768C10.0298 8.37768 10.013 8.37768 9.99628 8.38326Z" fill="#37BA8B"/>\r\n</svg>\r\n';
const _hoisted_1$7 = { class: "test-tree" };
const _hoisted_2$2 = { class: "tit" };
const _hoisted_3$2 = ["innerHTML"];
const _hoisted_4$2 = ["title"];
const _hoisted_5$1 = ["innerHTML"];
const _hoisted_6$1 = ["innerHTML"];
const _hoisted_7$1 = ["innerHTML"];
const _hoisted_8$1 = { class: "custom-tree-node" };
const _hoisted_9$1 = ["innerHTML"];
const _hoisted_10$1 = ["innerHTML"];
const _hoisted_11$1 = ["innerHTML"];
const _hoisted_12$1 = ["innerHTML"];
const _hoisted_13$1 = ["innerHTML"];
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
  __name: "TestTree",
  props: /* @__PURE__ */ mergeModels({
    taskId: { default: "" }
  }, {
    "current": { default: () => ({}) },
    "currentModifiers": {},
    "testStatus": { default: 1 },
    "testStatusModifiers": {},
    "treeRootName": {},
    "treeRootNameModifiers": {}
  }),
  emits: ["update:current", "update:testStatus", "update:treeRootName"],
  setup(__props, { expose: __expose }) {
    const testStore = useTestStore();
    const current = useModel(__props, "current");
    const testStatus = useModel(__props, "testStatus");
    const treeRootName = useModel(__props, "treeRootName");
    const props = __props;
    const statusMap = {
      1: { name: "开始测试", icon: "play" },
      2: { name: "暂停测试", icon: "pause" },
      3: { name: "继续测试", icon: "resume" }
    };
    const treeScroll = ref();
    const treeRef = ref();
    const loadTree = ref(true);
    const treeData = ref([]);
    const defaultCheckKeys = ref([]);
    const selectAndScrollToNode = (nodeId) => {
      var _a, _b;
      const node = (_a = treeRef.value) == null ? void 0 : _a.getNode(nodeId);
      if (!node) {
        return;
      }
      const nodeEl = document.querySelector(`.is-current`);
      if (!nodeEl) return;
      const scrollbar = (_b = treeScroll.value) == null ? void 0 : _b.wrapRef;
      if (!scrollbar) return;
      console.log("nodeEl", nodeEl);
      const containerHeight = scrollbar.clientHeight;
      const nodeHeight = nodeEl.clientHeight;
      const nodeTop = nodeEl.offsetTop;
      const targetScrollTop = nodeTop - containerHeight / 2 + nodeHeight / 2;
      const maxScrollTop = scrollbar.scrollHeight - containerHeight;
      const finalScrollTop = Math.max(0, Math.min(targetScrollTop, maxScrollTop));
      scrollbar.scrollTo({ top: finalScrollTop, behavior: "smooth" });
    };
    const getTreeData = async (isUpdate = false) => {
      !isUpdate && (loadTree.value = true);
      const { data } = await getTestCaseTrees({ keyword: null }, { taskId: props.taskId });
      treeData.value = data ? [{ ...data, children: handleData(data) }] : [];
      treeRootName.value = data.name || "";
      if (!isUpdate) {
        !current.value.id && findFirstChild(treeData.value);
        defaultCheckKeys.value = treeData.value.map((it) => it.id);
        loadTree.value = false;
      }
    };
    const handleData = (data) => {
      const caseList = [...data.testCases || [], ...data.childCase || []].map((it) => {
        return { ...it, isCase: true };
      });
      let children = [...data.childTree || [], ...caseList];
      if (children.length) {
        children = children.map((item) => {
          return { ...item, children: handleData(item) };
        });
      }
      return children;
    };
    const findFirstChild = (data) => {
      for (let i = 0; i < data.length; i++) {
        const children = data[i].children;
        if (Array.isArray(children) && children.length) {
          findFirstChild(children);
        } else {
          current.value = data[i];
          break;
        }
      }
    };
    const handleTest = async () => {
      var _a, _b;
      const taskId = props.taskId;
      testStatus.value = testStatus.value === 3 ? 2 : testStatus.value + 1;
      if (testStatus.value === 1) {
        const halfCheckedKeys = ((_a = treeRef.value) == null ? void 0 : _a.getHalfCheckedKeys()) || [];
        const checkedKeys = ((_b = treeRef.value) == null ? void 0 : _b.getCheckedKeys()) || [];
        const allChks = [...halfCheckedKeys, ...checkedKeys];
        const selectCaseIds = allChks || [];
        await startTest({ selectCaseIds }, { taskId });
      } else if (testStatus.value === 2) {
        pauseTest({}, { taskId });
      } else if (testStatus.value === 3) {
        resumeTest({}, { taskId });
      }
    };
    const handleStop = async () => {
      testStatus.value = 1;
      await stopTest({}, { taskId: props.taskId });
      testStore.updateState({ testStatus: 1 });
    };
    const handleNodeClick = (row) => {
      var _a;
      if (row.id === current.value.id) return;
      if (testStatus.value === 2) {
        ElMessage.warning("任务处于测试中，请暂停或结束任务后再查看");
        (_a = treeRef.value) == null ? void 0 : _a.setCurrentKey(current.value.id);
        return;
      }
      current.value = row;
    };
    watch(
      () => current.value.id,
      (newVal) => {
        if (newVal) {
          if (testStatus.value === 2) {
            nextTick(() => {
              if (current.value.id) {
                selectAndScrollToNode(current.value.id);
              }
            });
          }
        }
      }
    );
    const handleCheckChange = () => {
      var _a;
      defaultCheckKeys.value = ((_a = treeRef.value) == null ? void 0 : _a.getCheckedKeys()) || [];
    };
    const setTreeNodeData = () => {
      var _a;
      const row = (_a = treeRef.value) == null ? void 0 : _a.getNode(current.value.id || "");
      row && (row.data.testState = current.value.testState);
    };
    __expose({ getTreeData, handleStop, setTreeNodeData });
    return (_ctx, _cache) => {
      const _directive_loading = resolveDirective("loading");
      return openBlock(), createElementBlock("div", _hoisted_1$7, [
        createElementVNode("div", _hoisted_2$2, [
          _cache[0] || (_cache[0] = createElementVNode("div", { class: "name" }, "测试项目", -1)),
          testStatus.value !== 1 ? (openBlock(), createElementBlock("div", {
            key: 0,
            class: "btns stop-btns",
            title: "结束测试",
            onClick: handleStop
          }, [
            createElementVNode("span", { innerHTML: unref(testStop) }, null, 8, _hoisted_3$2)
          ])) : createCommentVNode("", true),
          createElementVNode("div", {
            class: "btns",
            title: statusMap[testStatus.value].name,
            onClick: handleTest
          }, [
            testStatus.value == 1 ? (openBlock(), createElementBlock("span", {
              key: 0,
              innerHTML: unref(testPlay)
            }, null, 8, _hoisted_5$1)) : testStatus.value == 2 ? (openBlock(), createElementBlock("span", {
              key: 1,
              innerHTML: unref(testPause)
            }, null, 8, _hoisted_6$1)) : testStatus.value == 3 ? (openBlock(), createElementBlock("span", {
              key: 2,
              innerHTML: unref(testResume)
            }, null, 8, _hoisted_7$1)) : createCommentVNode("", true)
          ], 8, _hoisted_4$2)
        ]),
        withDirectives((openBlock(), createBlock(unref(ElScrollbar), {
          ref_key: "treeScroll",
          ref: treeScroll,
          style: { "height": "calc(100% - 53px)" }
        }, {
          default: withCtx(() => [
            createVNode(unref(ElTree), {
              ref_key: "treeRef",
              ref: treeRef,
              data: treeData.value,
              "highlight-current": true,
              props: { label: "name" },
              "node-key": "id",
              "expand-on-click-node": false,
              "check-on-click-leaf": false,
              "default-expand-all": "",
              "default-checked-keys": defaultCheckKeys.value,
              "show-checkbox": "",
              "icon-class": "el-icon-arrow-right",
              "current-node-key": current.value.id,
              onNodeClick: handleNodeClick,
              onCheckChange: handleCheckChange
            }, {
              default: withCtx(({ data }) => [
                createElementVNode("div", _hoisted_8$1, [
                  data.isCase ? (openBlock(), createElementBlock("span", {
                    key: 0,
                    innerHTML: unref(nodeSvg)
                  }, null, 8, _hoisted_9$1)) : (openBlock(), createElementBlock("span", {
                    key: 1,
                    innerHTML: unref(folder)
                  }, null, 8, _hoisted_10$1)),
                  createVNode(unref(TooltipBox), {
                    content: data.name,
                    tooltipAttrs: { placement: "right", offset: 38 }
                  }, null, 8, ["content"]),
                  data.testState == "Testing" ? (openBlock(), createElementBlock("span", {
                    key: 2,
                    innerHTML: unref(testing)
                  }, null, 8, _hoisted_11$1)) : data.testState == "TestFaild" ? (openBlock(), createElementBlock("span", {
                    key: 3,
                    innerHTML: unref(testFailed)
                  }, null, 8, _hoisted_12$1)) : data.testState == "TestPass" ? (openBlock(), createElementBlock("span", {
                    key: 4,
                    innerHTML: unref(testAdopt)
                  }, null, 8, _hoisted_13$1)) : createCommentVNode("", true)
                ])
              ]),
              _: 1
            }, 8, ["data", "default-checked-keys", "current-node-key"])
          ]),
          _: 1
        })), [
          [_directive_loading, loadTree.value]
        ])
      ]);
    };
  }
});
const _export_sfc = (sfc, props) => {
  const target = sfc.__vccOpts || sfc;
  for (const [key, val] of props) {
    target[key] = val;
  }
  return target;
};
const TestTree = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-81e4cdfb"]]);
function formatNumToTh(num = 0, unit, preUnit) {
  const numStr = String(num).replace(/,/g, "");
  const parts = numStr.split(".");
  let integerPart = parts[0];
  const decimalPart = parts.length > 1 ? `.${parts[1]}` : "";
  integerPart = integerPart.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
  return "" + (integerPart + decimalPart);
}
function useConfig(content = {}) {
  const { taskId } = content;
  const typeMap = {
    无线电监测测向: {
      监测灵敏度: {
        type: 1,
        chartType: "line",
        x: { label: "频率(MHz)", prop: "frequency" },
        y: { label: "灵敏度(dBμV/m)", prop: "value" },
        config: [
          { label: "测试频率(MHz)", prop: "frequency" },
          { label: "频谱发现灵敏度(dBμV/m)", prop: "value" }
        ]
      },
      场强测量精度: {
        type: 2,
        chartType: "line",
        x: { label: "频率(MHz)", prop: "frequency" },
        y: { label: "精度(dB)", prop: "fieldAccuracy" },
        config: [
          { label: "测试频率(MHz)", prop: "frequency" },
          { label: "场强测量系统测试结果(dBμV/m)", prop: "fieldResult" },
          { label: "被测系统测量结果(dBμV/m)", prop: "underTestReuslt" },
          { label: "场强测量精度(dB)", prop: "fieldAccuracy" }
        ]
      },
      频率测量精度: {
        type: 3,
        chartType: "bar",
        x: { label: "频率(MHz)", prop: "frequency" },
        y: { label: "精度", prop: "absoluteAccuracy" },
        seriesConfig: [
          { label: "绝对测量精度", prop: "absoluteAccuracy" },
          { label: "相对测量精度", prop: "relativeAccuracy" }
        ],
        config: [
          { label: "发射系统频率(MHz)", prop: "frequency" },
          { label: "被测系统读出频率(MHz)", prop: "underTestFrequency" },
          { label: "绝对测量精度(Hz)", prop: "absoluteAccuracy" },
          { label: "相对测量精度(10^-6)", prop: "relativeAccuracy" }
        ]
      },
      识别信号能力: {
        type: 4,
        chartType: "",
        config: []
      },
      测向灵敏度: {
        type: 5,
        chartType: "line",
        x: { label: "频率(MHz)", prop: "frequency" },
        y: { label: "场强读数(dBμV/m)", prop: "field" },
        config: [
          { label: "测试频率(MHz)", prop: "frequency" },
          { label: "大信号时的稳定示向度θ(°)", prop: "angle" },
          { label: "示向度偏离θ为6时场强测量系统读数(dBμV/m)", prop: "field" }
        ]
      },
      测向精度: {
        type: 6,
        chartType: "line",
        x: { label: "频率(MHz)", prop: "frequency" },
        y: { label: "均方差(°)", prop: "meanSquareError" },
        config: [
          { label: "频率(MHz)", prop: "frequency" },
          { label: "参考角度(°)", prop: "refAngle" },
          { label: "信号功率(dBm)", prop: "signalLevel" },
          { label: "示向度1(°)", prop: "angle001" },
          { label: "示向度2(°)", prop: "angle002" },
          { label: "示向度3(°)", prop: "angle003" },
          { label: "均值(°)", prop: "average" },
          { label: "均方差(°)", prop: "meanSquareError" }
        ]
      },
      带内抗扰度: {
        type: 7,
        chartType: "line",
        x: { label: "频率(MHz)", prop: "frequency" },
        y: { label: "带内抗扰度(dB)", prop: "inBandResult" },
        config: [
          { label: "频率(MHz)", prop: "frequency" },
          { label: "发射系统1输出功率(dBm)", prop: "output1" },
          { label: "发射系统2输出功率(dBm)", prop: "output2" },
          { label: "带内抗扰度(dB)", prop: "inBandResult" }
        ]
      },
      抑制度: {
        type: 8,
        chartType: "bar",
        x: { label: "频率(MHz)", prop: "frequency" },
        y: { label: "互调抑制度(dB)", prop: "result" },
        seriesConfig: [{ label: "互调抑制度", prop: "result" }],
        config: [
          { label: "频率(MHz)", prop: "frequency" },
          { label: "输出功率P1(dBm)", prop: "p1" },
          { label: "输出功率P2(dBm)", prop: "p2" },
          { label: "互调抑制度(dB)", prop: "result" }
        ]
      },
      瞬时信号的监测和测向能力: {
        type: 9,
        chartType: "bar",
        x: { label: "频率(MHz)", prop: "frequency" },
        y: { label: "时间(ms)", prop: "monitorTime" },
        seriesConfig: [
          { label: "监测最小驻留时间", prop: "monitorTime" },
          { label: "测向最小驻留时间", prop: "directionTime" }
        ],
        config: [
          { label: "发射系统频率(MHz)", prop: "frequency" },
          { label: "监测最小驻留时间(ms)", prop: "monitorTime" },
          { label: "测向最小驻留时间(ms)", prop: "directionTime" }
        ]
      }
    },
    固定站检测: {
      天波测向精度: {
        type: 16,
        chartType: "",
        config: [
          { label: "测试频率(kHz)", prop: "frequency", minWidth: "100" },
          {
            label: "监测时间",
            prop: "moniTime",
            type: "editable",
            editType: "datePicker",
            format: "YYYY-MM-DD HH:mm:ss",
            valueFormat: "YYYY-MM-DD HH:mm:ss",
            dateType: "datetime",
            minWidth: 150
          },
          { label: "发射类别", prop: "signalType", type: "editable", editType: "input" },
          { label: "台址", prop: "baseAdress", type: "editable", editType: "input" },
          { label: "纬度", prop: "latitude", type: "editable", editType: "input" },
          { label: "经度", prop: "longitude", type: "editable", editType: "input" },
          { label: "理论示向度θ", prop: "realAngle", type: "editable", editType: "input" },
          { label: "测试示向度θ", prop: "testAverage", type: "editable", editType: "input" },
          { label: "偏差Δθ", prop: "deviation", type: "editable", editType: "input" }
        ],
        onChange: (_, row) => {
          updateSkyDirectionAccuracyTestResult({ testResult: { ...row, moniTimeDatePicker: void 0 } }, { taskId });
        }
      },
      地波测向精度: {
        type: 17,
        chartType: "",
        config: [
          { label: "频率(kHz)", prop: "frequency" },
          { label: "示向度θ", prop: "testAverage", type: "editable", editType: "input" },
          { label: "偏差Δθ", prop: "deviation", type: "editable", editType: "input" }
        ],
        onChange: (_, row) => {
          updateGroundDirectionAccuracyTestResult({ testResult: row }, { taskId });
        }
      },
      监测灵敏度: {
        type: 10,
        chartType: "line",
        x: { label: "频率(MHz)", prop: "frequency" },
        y: { label: "监测灵敏度E(dBμV/m)", prop: "field" },
        config: [
          { label: "测试频率(MHz)", prop: "frequency", minWidth: "110" },
          { label: "E0(dBuV/m)", prop: "field0" },
          { label: "P1(dBm)", prop: "power1" },
          { label: "P2(dBm)", prop: "power2" },
          { label: "监测灵敏度E(dBμV/m)", prop: "field" }
        ]
      },
      测向灵敏度: {
        type: 11,
        chartType: "line",
        x: { label: "频率(MHz)", prop: "frequency" },
        y: { label: "监测灵敏度E(dBμV/m)", prop: "field" },
        config: [
          { label: "测试频率(MHz)", prop: "frequency", minWidth: "110" },
          { label: "示向度θ(°)", prop: "angle" },
          { label: "E0(dBμV/m)", prop: "field0" },
          { label: "P1(dBm)", prop: "power1" },
          { label: "P2(dBm)", prop: "power2" },
          { label: "监测灵敏度E(dBμV/m)", prop: "field" }
        ]
      },
      频率准确度: {
        type: 12,
        chartType: "bar",
        x: { label: "频率(MHz)", prop: "frequency" },
        y: { label: "精度", prop: "absoluteAccuracy" },
        seriesConfig: [
          { label: "绝对测量精度", prop: "absoluteAccuracy" },
          { label: "相对测量精度", prop: "relativeAccuracy" }
        ],
        config: [
          { label: "发射系统频率(MHz)", prop: "frequency", minWidth: "130" },
          { label: "被测系统读出频率(MHz)", prop: "underTestFrequency" },
          { label: "绝对测量精度(Hz)", prop: "absoluteAccuracy" },
          { label: "相对测量精度(ppm)", prop: "relativeAccuracy" }
        ]
      },
      监测最小信号时长: {
        type: 13,
        chartType: "line",
        x: { label: "频率(MHz)", prop: "frequency" },
        y: { label: "监测最小信号时长(ms)", prop: "monitorTime" },
        config: [
          { label: "测试频率(MHz)", prop: "frequency" },
          { label: "监测最小信号时长(ms)", prop: "monitorTime" }
        ]
      },
      测向最小信号时长: {
        type: 14,
        chartType: "line",
        x: { label: "频率(MHz)", prop: "frequency" },
        y: { label: "测向最小信号时长(ms)", prop: "directionTime" },
        config: [
          { label: "测试频率(MHz)", prop: "frequency" },
          { label: "测向最小信号时长(ms)", prop: "directionTime" }
        ]
      },
      抑制度: {
        type: 15,
        chartType: "bar",
        x: { label: "频率(MHz)", prop: "frequency" },
        y: { label: "互调抑制度(dB)", prop: "result" },
        seriesConfig: [{ label: "互调抑制度", prop: "result" }],
        config: [
          { label: "频率(MHz)", prop: "frequency", minWidth: "100" },
          { label: "输出功率P1(dBm)", prop: "p1" },
          { label: "输出功率P2(dBm)", prop: "p2" },
          { label: "互调抑制度(dB)", prop: "result" }
        ]
      }
    }
  };
  const getLineChartJson = (data = [], row) => {
    var _a, _b, _c;
    return {
      grid: {
        top: 50,
        left: 60,
        right: 20,
        bottom: 40
      },
      tooltip: {
        trigger: "axis",
        axisPointer: {
          lineStyle: {
            color: "#3A6EF6",
            width: 2
          }
        },
        // triggerOn: "click",
        className: "test-project-tooltip-box",
        textStyle: {
          color: "#1d2129",
          fontSize: 12
        },
        padding: 8,
        formatter: (vals) => {
          let html = `<div class="tit">${vals[0].axisValue}</div><div class="list">`;
          vals.forEach((it) => {
            const { value, seriesName } = it;
            html += `<div class="name-val">
              <span class="name">${seriesName}</span>
              <span class="val">${formatNumToTh(value)}</span>
            </div>`;
          });
          html += `</div>`;
          return html;
        }
      },
      xAxis: {
        type: "category",
        name: (_a = row.x) == null ? void 0 : _a.label,
        nameTextStyle: {
          padding: [-20, 0, 0, -60],
          color: "#666",
          verticalAlign: "top"
        },
        boundaryGap: false,
        axisLine: {
          onZero: false,
          lineStyle: {
            color: "#ddd"
          }
        },
        axisLabel: {
          color: "#999"
          // interval: 4
        },
        data: data.map((it) => {
          var _a2;
          return it[(_a2 = row.x) == null ? void 0 : _a2.prop];
        })
      },
      yAxis: {
        type: "value",
        name: (_b = row.y) == null ? void 0 : _b.label,
        nameTextStyle: {
          padding: [0, 0, 5, -20],
          color: "#666",
          align: "left"
        },
        splitLine: {
          show: true,
          lineStyle: {
            type: "dashed",
            color: "#ddd"
          }
        },
        axisLabel: {
          color: "#999"
        }
      },
      series: [
        {
          type: "line",
          data: data.map((it) => {
            var _a2;
            return it[(_a2 = row.y) == null ? void 0 : _a2.prop];
          }),
          symbolSize: 0,
          name: (_c = row.y) == null ? void 0 : _c.label,
          lineStyle: {
            color: {
              type: "linear",
              x: 0,
              y: 0,
              x2: 1,
              y2: 0,
              colorStops: [
                { offset: 0, color: "#13DAF1" },
                { offset: 1, color: "#3A6EF6" }
              ],
              global: false
            }
          },
          itemStyle: {
            color: "#3A6EF6",
            borderWidth: 2,
            borderColor: "#3A6EF6",
            opacity: 0
          },
          emphasis: {
            itemStyle: {
              opacity: 1
            }
          }
        }
      ]
    };
  };
  const getBarChartJson = (data = [], row) => {
    var _a, _b, _c;
    return {
      color: ["#3A6EF6", "#13DAF1"],
      grid: {
        top: 50,
        left: 100,
        right: 20,
        bottom: 40
      },
      legend: {
        top: 10,
        itemGap: 20
      },
      tooltip: {
        trigger: "axis",
        axisPointer: {
          type: "shadow"
        },
        className: "test-project-tooltip-box",
        textStyle: {
          color: "#1d2129",
          fontSize: 12
        },
        padding: 8,
        formatter: (vals) => {
          let html = `<div class="tit">${vals[0].axisValue}</div><div class="list">`;
          vals.forEach((it) => {
            const { value, seriesName, color } = it;
            html += `<div class="name-val">
              <span class="name"><i style="background: ${color}"></i>${seriesName}</span>
              <span class="val">${formatNumToTh(value)}</span>
            </div>`;
          });
          html += `</div>`;
          return html;
        }
      },
      xAxis: {
        type: "category",
        name: (_a = row.x) == null ? void 0 : _a.label,
        nameTextStyle: {
          padding: [-20, 0, 0, -60],
          color: "#666",
          verticalAlign: "top"
        },
        boundaryGap: true,
        axisLine: {
          onZero: false,
          lineStyle: {
            color: "#ddd"
          }
        },
        axisLabel: {
          color: "#999"
        },
        data: data.map((it) => {
          var _a2;
          return it[(_a2 = row.x) == null ? void 0 : _a2.prop];
        })
      },
      yAxis: {
        type: "value",
        name: (_b = row.y) == null ? void 0 : _b.label,
        nameTextStyle: {
          padding: [0, 0, 5, -20],
          color: "#666",
          align: "left"
        },
        splitLine: {
          show: true,
          lineStyle: {
            type: "dashed",
            color: "#ddd"
          }
        },
        axisLabel: {
          color: "#999"
        }
      },
      series: (_c = row.seriesConfig) == null ? void 0 : _c.map((it) => {
        return {
          name: it.label,
          type: "bar",
          barGap: 0,
          emphasis: {
            focus: "series"
          },
          barMinHeight: 10,
          barWidth: 30,
          data: data.map((x) => x[it.prop])
        };
      })
    };
  };
  function formatConfig(row, data) {
    var _a;
    if (row.type === 4) {
      let frequencyArr = data.map((it) => it.frequency);
      frequencyArr = frequencyArr.filter((it, i) => frequencyArr.indexOf(it) === i);
      const titleList = frequencyArr.map((it) => {
        return { label: it + "MHz", prop: String(it) };
      });
      const fixedConfig = [
        { label: "序号", prop: "index", width: "50", fixed: "left" },
        { label: "", prop: "type", width: "80" },
        { label: "", prop: "name", width: "100" }
      ];
      let types = data.map((it) => it.modlulitionType);
      types = types.filter((it, i) => types.indexOf(it) === i);
      const tableData = [];
      types.forEach((it, i) => {
        const rows = data.filter((x) => x.modlulitionType === it);
        const obj1 = {};
        const obj2 = {};
        rows.forEach((x) => {
          obj1[String(x.frequency)] = x.isIdentify || false;
          obj2[String(x.frequency)] = x.identifyTime || 0;
        });
        tableData.push({ index: i + 1, type: it, name: "是否正确识别", ...obj1 }, { index: i + 1, type: it, name: "识别时长(s)", ...obj2 });
      });
      const spanMethod = ({ rowIndex, columnIndex }) => {
        if (columnIndex < 2) {
          if (rowIndex % 2 === 0) {
            return { rowspan: 2, colspan: 1 };
          } else {
            return { rowspan: 0, colspan: 0 };
          }
        }
      };
      return { config: data.length ? [...fixedConfig, ...titleList] : [], tableData, spanMethod, indexColumn: false };
    } else {
      const config = (_a = row.config) == null ? void 0 : _a.map((it) => {
        row.onChange && (it.onChange = row.onChange);
        return it;
      });
      return { config, indexColumn: true };
    }
  }
  function getJson(name = "监测灵敏度", data = [], type = "无线电监测测向") {
    if (name.includes("_")) {
      name = "测向精度";
    }
    const typeRow = typeMap[type] || {};
    const key = Object.keys(typeRow).find((it) => name.includes(it));
    const row = typeRow[key] || {};
    let json = {};
    if ((row == null ? void 0 : row.chartType) === "line") {
      json = getLineChartJson(data, row);
    } else if ((row == null ? void 0 : row.chartType) === "bar") {
      json = getBarChartJson(data, row);
    }
    const { config, tableData, spanMethod, indexColumn } = formatConfig(row, data);
    return { json, config, type: row.type, data: tableData, spanMethod, indexColumn };
  }
  return { getJson };
}
const _hoisted_1$6 = { class: "chart-view" };
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
  __name: "ChartView",
  props: {
    dataLen: { default: 0 },
    caseName: { default: "" }
  },
  setup(__props, { expose: __expose }) {
    let lineChart = null;
    const props = __props;
    const lineChartRef = ref();
    onMounted(async () => {
      nextTick(() => {
        initEchart();
      });
    });
    onBeforeUnmount(() => {
      window.removeEventListener("resize", chartResize);
    });
    const initEchart = () => {
      lineChart = echarts.init(lineChartRef.value);
      window.addEventListener("resize", chartResize);
    };
    const chartResize = () => {
      lineChart.resize();
    };
    const drawChart = (data, treeRootName) => {
      lineChart.clear();
      lineChart.setOption(useConfig().getJson(props.caseName, data, treeRootName).json);
      chartResize();
    };
    __expose({ chartResize, drawChart });
    return (_ctx, _cache) => {
      const _component_Empty = resolveComponent("Empty");
      return openBlock(), createElementBlock("div", _hoisted_1$6, [
        withDirectives(createElementVNode("div", {
          ref_key: "lineChartRef",
          ref: lineChartRef,
          class: "chart-box"
        }, null, 512), [
          [vShow, _ctx.dataLen]
        ]),
        withDirectives(createVNode(_component_Empty, null, null, 512), [
          [vShow, !_ctx.dataLen]
        ])
      ]);
    };
  }
});
const ChartView = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-21e624ce"]]);
const _hoisted_1$5 = { class: "ground-wave-form" };
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
  __name: "GroundWaveForm",
  props: {
    tableList: { default: () => [] }
  },
  emits: ["updateList"],
  setup(__props, { emit: __emit }) {
    const testStore = useTestStore();
    const props = __props;
    const emits = __emit;
    const taskId = testStore.taskId;
    watch(
      () => props.tableList,
      (val) => {
        const nameRow = config.value.find((it) => it.prop === "id");
        if (nameRow) {
          nameRow.options = val.map((it) => ({ label: it.name, value: it.id }));
          getGroudWaveList(props.tableList[0] || {});
        }
      }
    );
    const formView = ref(null);
    const config = ref([
      {
        label: "发射源",
        prop: "id",
        type: "select",
        options: [],
        required: true,
        onChange: async (val) => {
          const row = props.tableList.find((it) => it.id === val);
          if (row) {
            getGroudWaveList(row);
          }
        }
      },
      { label: "经度", prop: "longitude", inputType: "number" },
      { label: "纬度", prop: "latitude", inputType: "number" },
      { label: "距离", prop: "distance", inputType: "number" },
      { label: "理论示向角", prop: "realAngle", inputType: "number" }
    ]);
    const formData = ref({});
    const tableKey = ref(+/* @__PURE__ */ new Date());
    onMounted(() => {
      console.log("日志组件数据加载", testStore.taskId);
      config.value.forEach((item) => {
        if (!item.onChange) {
          item.onChange = async () => {
            var _a;
            formData.value = { ...formData.value, ...((_a = formView.value) == null ? void 0 : _a.data) || {} };
            const index = props.tableList.findIndex((it) => it.id === formData.value.id);
            props.tableList[index] = formData.value;
            await updateGeneratorInfo({ generator: formData.value }, { taskId });
          };
        }
      });
      tableKey.value = +/* @__PURE__ */ new Date();
    });
    const getGroudWaveList = async (row) => {
      formData.value = JSON.parse(JSON.stringify(row));
      const { data } = await getGroundDirectionAccuracies({ generatorId: row.id }, { taskId });
      emits("updateList", data || []);
    };
    return (_ctx, _cache) => {
      const _component_XcForm = resolveComponent("XcForm");
      return openBlock(), createElementBlock("div", _hoisted_1$5, [
        (openBlock(), createBlock(_component_XcForm, {
          key: tableKey.value,
          class: "form-view",
          ref_key: "formView",
          ref: formView,
          config: config.value,
          values: formData.value,
          colProps: 4,
          labelPosition: "right"
        }, null, 8, ["config", "values"]))
      ]);
    };
  }
});
const _hoisted_1$4 = { class: "table-view" };
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
  ...{
    name: "TableBox",
    components: {}
  },
  __name: "index",
  props: {
    caseName: { default: "" },
    tableList: { default: () => [] },
    treeRootName: { default: "" },
    caseType: { default: 0 },
    testStatus: { default: 1 }
  },
  setup(__props, { expose: __expose }) {
    const testStore = useTestStore();
    const props = __props;
    const tableView = ref();
    const groundWaveTableData = ref([]);
    const resultJson = computed(() => {
      var _a;
      console.log("获取配置");
      const json = useConfig({ taskId: String(testStore.taskId || "") }).getJson(props.caseName, props.tableList, props.treeRootName);
      (_a = json.config) == null ? void 0 : _a.forEach((it) => {
        if (["input", "datePicker"].includes(String(it.editType))) {
          it.type = props.testStatus !== 1 ? "text" : "editable";
        }
      });
      return json;
    });
    const showTableData = computed(() => {
      return props.caseType === 17 ? groundWaveTableData.value : resultJson.value.data || props.tableList;
    });
    const scrollBottom = (isReset = false) => {
      nextTick(() => {
        const table = tableView.value.table.layout.table.refs;
        const ele = table.bodyWrapper.firstElementChild.firstElementChild;
        ele.scrollTop = isReset ? 0 : ele.scrollHeight;
      });
    };
    const updateList = (list) => {
      groundWaveTableData.value = list || [];
    };
    __expose({ scrollBottom });
    return (_ctx, _cache) => {
      const _component_XcTable = resolveComponent("XcTable");
      return openBlock(), createElementBlock("div", _hoisted_1$4, [
        _ctx.caseType === 17 ? (openBlock(), createBlock(_sfc_main$5, {
          key: 0,
          tableList: _ctx.tableList,
          onUpdateList: updateList
        }, null, 8, ["tableList"])) : createCommentVNode("", true),
        (openBlock(), createBlock(_component_XcTable, {
          class: normalizeClass(["is-list", { "ground-wave-table": _ctx.caseType === 17 }]),
          ref_key: "tableView",
          ref: tableView,
          isQuickEditable: _ctx.testStatus === 1,
          quickEditable: { deleteDisabled: true, addDisabled: true },
          key: _ctx.caseName,
          tableKey: _ctx.caseName,
          config: resultJson.value.config,
          values: JSON.parse(JSON.stringify(showTableData.value)),
          indexColumn: resultJson.value.indexColumn,
          spanMethod: resultJson.value.spanMethod
        }, null, 8, ["class", "isQuickEditable", "tableKey", "config", "values", "indexColumn", "spanMethod"]))
      ]);
    };
  }
});
const TableBox = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-ab5ea39c"]]);
const _hoisted_1$3 = { class: "params-view" };
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
  __name: "ParamsView",
  props: {
    caseId: { default: "" }
  },
  setup(__props, { expose: __expose }) {
    const route = useRoute();
    const props = __props;
    const isLoading = ref(false);
    const nodeData = ref([]);
    const getConfigData = (data) => {
      nodeData.value = data || [];
    };
    const handleUpdate = async () => {
      updateTestCaseConfig({ caseId: props.caseId || "", config: nodeData.value }, { taskId: route.query.taskId });
      ElMessage.success("参数更新成功");
    };
    __expose({ getConfigData });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$3, [
        _cache[0] || (_cache[0] = createElementVNode("div", { class: "tit" }, "参数", -1)),
        createVNode(unref(NodeTree), {
          isLoading: isLoading.value,
          class: "node-tree",
          ref: "nodeTreeRef",
          data: nodeData.value,
          onUpdateForm: handleUpdate
        }, null, 8, ["isLoading", "data"])
      ]);
    };
  }
});
const ParamsView = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-3284a1fb"]]);
const _hoisted_1$2 = {
  key: 0,
  class: "list"
};
const _hoisted_2$1 = { class: "item" };
const _hoisted_3$1 = { class: "time" };
const _hoisted_4$1 = { class: "summary" };
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
  __name: "TestLog",
  setup(__props, { expose: __expose }) {
    const query = ref({ pageIndex: 1, pageSize: 100 });
    const logList = ref([]);
    const total = ref(0);
    const testStore = useTestStore();
    onMounted(() => {
      getTestLog();
    });
    const getTestLog = async () => {
      console.log("准备获取日志列表");
      try {
        const result = await getTestLogsByPage(query.value, { taskId: testStore.taskId || "" });
        console.log("获取日志列表成功", result);
        console.log("logList值:", logList.value);
        const data = (result == null ? void 0 : result.data) || {};
        const list = (data == null ? void 0 : data.list) || [];
        const total_Count = (data == null ? void 0 : data.total_Count) || 0;
        logList.value = [...logList.value, ...list];
        total.value = total_Count;
      } catch (error) {
        console.error("获取日志列表失败", error);
        logList.value = [];
        total.value = 0;
      }
    };
    const setTestLog = (log) => {
      logList.value.push({ ...log, id: String(+/* @__PURE__ */ new Date()) });
    };
    const clearTestLog = () => {
      logList.value = [];
    };
    const scrollEnd = () => {
      if (logList.value.length < total.value) {
        console.log("滚动到最底部");
        query.value.pageIndex++;
        getTestLog();
      }
    };
    __expose({ setTestLog, clearTestLog });
    return (_ctx, _cache) => {
      const _component_DynamicScrollerItem = resolveComponent("DynamicScrollerItem");
      const _component_DynamicScroller = resolveComponent("DynamicScroller");
      const _component_Empty = resolveComponent("Empty");
      const _component_el_scrollbar = resolveComponent("el-scrollbar");
      return openBlock(), createBlock(_component_el_scrollbar, { class: "test-log" }, {
        default: withCtx(() => [
          Array.isArray(logList.value) && logList.value.length ? (openBlock(), createElementBlock("div", _hoisted_1$2, [
            logList.value && logList.value.length ? (openBlock(), createBlock(_component_DynamicScroller, {
              key: 0,
              style: { "height": "100%", "overflow": "auto" },
              items: logList.value,
              "key-field": "id",
              "min-item-size": 30,
              onScrollEnd: scrollEnd
            }, {
              default: withCtx(({ item, index, active }) => [
                item ? (openBlock(), createBlock(_component_DynamicScrollerItem, {
                  key: 0,
                  item,
                  active,
                  "data-index": index
                }, {
                  default: withCtx(() => [
                    createElementVNode("div", _hoisted_2$1, [
                      createElementVNode("div", _hoisted_3$1, toDisplayString(item.time), 1),
                      createElementVNode("div", _hoisted_4$1, toDisplayString(item.summary), 1)
                    ])
                  ]),
                  _: 2
                }, 1032, ["item", "active", "data-index"])) : createCommentVNode("", true)
              ]),
              _: 1
            }, 8, ["items"])) : createCommentVNode("", true)
          ])) : (openBlock(), createBlock(_component_Empty, {
            key: 1,
            props: { imageSize: 80 }
          }))
        ]),
        _: 1
      });
    };
  }
});
const TestLog = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-b3e36a1f"]]);
const _hoisted_1$1 = { class: "left-params" };
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
  __name: "LeftParams",
  props: {
    testStatus: {},
    required: { type: Boolean }
  },
  setup(__props, { expose: __expose }) {
    const testStore = useTestStore();
    const props = __props;
    const config = computed(
      () => {
        return [
          {
            label: props.testStatus === 1 ? "测试情况统计" : "测试情况",
            type: "title"
          },
          { label: "测试进度", prop: "progress", type: "slot", slot: "progress" },
          { label: "测试时长", prop: "time" },
          { label: "测试环境", type: "title" },
          { label: "温度", prop: "temperature" },
          { label: "湿度", prop: "humidity" },
          { label: "大气压", prop: "pressure" },
          { label: "风向", prop: "windDirection" }
        ];
      }
    );
    const detail = ref({});
    const setData = (data) => {
      detail.value = { ...detail.value, ...data };
    };
    const getData = async () => {
      const { data } = await getEnvironment({}, { taskId: String(testStore.taskId || "") });
      setData(data);
      const result = await getTestStatisticsInfo({}, { taskId: String(testStore.taskId || "") });
      if (!result.data || result.data.progress === void 0 || result.data.time === void 0) {
        return;
      }
      detail.value.progress = result.data.progress;
      detail.value.time = result.data.time;
    };
    watch(
      () => props.testStatus,
      () => {
        console.log("测试状态变化", props.testStatus);
        getData();
      },
      { immediate: true }
    );
    __expose({ setData, getData });
    return (_ctx, _cache) => {
      const _component_el_progress = resolveComponent("el-progress");
      const _component_XcTable = resolveComponent("XcTable");
      const _component_el_scrollbar = resolveComponent("el-scrollbar");
      return openBlock(), createElementBlock("div", _hoisted_1$1, [
        createVNode(_component_el_scrollbar, { class: "scroll-bar" }, {
          default: withCtx(() => [
            createVNode(_component_XcTable, {
              labelWidth: "80px",
              config: config.value,
              value: detail.value,
              type: "descriptions",
              border: true,
              ref: "tableView"
            }, {
              progress: withCtx(() => [
                createVNode(_component_el_progress, {
                  percentage: detail.value.progress
                }, null, 8, ["percentage"])
              ]),
              _: 1
            }, 8, ["config", "value"])
          ]),
          _: 1
        })
      ]);
    };
  }
});
const LeftParams = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-ecbd686f"]]);
const _hoisted_1 = {
  ref: "split",
  class: "split"
};
const _hoisted_2 = {
  ref: "leftView",
  class: "left-view"
};
const _hoisted_3 = {
  ref: "testTree",
  class: "test-tree-box"
};
const _hoisted_4 = {
  ref: "leftParams",
  class: "left-params-box"
};
const _hoisted_5 = {
  ref: "rightView",
  class: "right-view"
};
const _hoisted_6 = { class: "right-ct" };
const _hoisted_7 = { class: "tit" };
const _hoisted_8 = { class: "r-ct" };
const _hoisted_9 = {
  ref: "chartTable",
  class: "chart-table"
};
const _hoisted_10 = { ref: "chartBox" };
const _hoisted_11 = { ref: "tableBox" };
const _hoisted_12 = { class: "table-box" };
const _hoisted_13 = {
  key: 0,
  class: "tab-list"
};
const _hoisted_14 = ["onClick"];
const _hoisted_15 = {
  ref: "paramsTurn",
  class: "params-turn"
};
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "index",
  setup(__props, { expose: __expose }) {
    const dataEvent = (data) => {
      console.log("子组件收到数据了", data);
      handleEvent(data);
    };
    __expose({
      dataEvent
    });
    const testStore = useTestStore();
    console.log("存储后 Pinia 中的值：", testStore.sendTestCmd);
    const showDialog = async (config, taskId) => {
      return createDialog(
        {
          config,
          bizData: taskId,
          onCallback: async (params) => {
            await dialogCallback(params, { taskId });
          }
        },
        { Vue: { createApp }, ElementPlus }
      );
    };
    let splitList = [];
    const testTreeRef = ref();
    const leftParamsRef = ref();
    const chartViewRef = ref();
    const tableViewRef = ref();
    const paramsBoxRef = ref();
    const testLog = ref();
    const taskInfo = ref({ id: String(testStore.taskId || "") });
    const testStatus = ref(1);
    const currentCase = ref({});
    const chartData = ref([]);
    const treeRootName = ref("");
    watch(() => testStore.taskId, (val) => {
      taskInfo.value.id = val;
    });
    const angle = ref("");
    const angleOptions = ref([]);
    const angleGroup = ref({});
    const tab = ref(1);
    const tabList = [
      { name: "结果", value: 1 },
      { name: "输出", value: 2 }
      // { name: "SOAP交互", value: 3 }
    ];
    const resultLoading = ref(false);
    const caseType = computed(() => {
      return useConfig().getJson(currentCase.value.name, [], treeRootName.value).type;
    });
    watch(
      () => currentCase.value.id,
      (val) => {
        var _a;
        if (val && testStatus.value !== 2) {
          getCaseReults();
          getCaseConfig();
        }
        console.log(caseType.value);
        (_a = splitList[2]) == null ? void 0 : _a.setSizes([4, 16, 17].includes(caseType.value) ? [0, 100] : [68, 32]);
      }
    );
    watch(testStatus, (_, oldVal) => {
      if (oldVal === 1) {
        clearTestData();
      }
    });
    onMounted(() => {
      handleOpenTask();
      initSplit();
      window.addEventListener("beforeunload", closeFn);
    });
    onBeforeUnmount(() => {
      window.removeEventListener("beforeunload", closeFn);
      closeFn();
    });
    onActivated(() => {
      nextTick(() => {
        var _a;
        (_a = chartViewRef.value) == null ? void 0 : _a.chartResize();
      });
    });
    onUnmounted(() => {
      console.log("测试页面卸载，清除事件");
    });
    const closeFn = () => {
      closeTask(void 0, { taskId: taskInfo.value.id });
    };
    const handleEvent = (param) => {
      var _a, _b, _c, _d, _e;
      const { dataName, data } = param || {};
      console.log("dataName", dataName, "data", data);
      switch (dataName) {
        case "TestResult":
          {
            if (caseType.value === 6) {
              setDataGroup(data);
              if (angle.value !== data.refAngle) {
                angle.value = data.refAngle;
                chartData.value = [];
              }
            }
            chartData.value.push(data);
            (_a = chartViewRef.value) == null ? void 0 : _a.drawChart(chartData.value, treeRootName.value);
            (_b = tableViewRef.value) == null ? void 0 : _b.scrollBottom();
            if (testStatus.value === 1) {
              testStatus.value = 2;
            }
          }
          break;
        case "TestCaseChanged":
          {
            if (data.id !== currentCase.value.id) {
              chartData.value = [];
              (_c = paramsBoxRef.value) == null ? void 0 : _c.getConfigData(data.config);
            }
            currentCase.value = { ...data, config: [] };
            nextTick(() => {
              var _a2;
              (_a2 = testTreeRef.value) == null ? void 0 : _a2.setTreeNodeData();
            });
          }
          break;
        case "TestState":
          {
            console.log("测试状态", data);
            if (["MeasureStartop", "WaitForMeasure"].includes(data)) {
              testStatus.value = 1;
              testStore.updateState({ testStatus: 1 });
            } else if (data === "MeasurePause") {
              testStatus.value = 3;
            }
          }
          break;
        case "TestLog":
          {
            console.log("测试日志：", data);
            (_d = testLog.value) == null ? void 0 : _d.setTestLog(data);
          }
          break;
        case "TestStatus":
          {
            (_e = leftParamsRef.value) == null ? void 0 : _e.setData(data);
          }
          break;
        case "TestDialogEvent":
          {
            console.log("对话框消息：", data);
            if (data.tipDialogType === "DynamicFormDialog") {
              data.result = JSON.parse(JSON.stringify(data.params));
            }
            showDialog(data || {}, taskInfo.value.id || "");
          }
          break;
        case "TestMessageEvent":
          ElMessage({
            message: data.message,
            type: data.type || "info"
          });
      }
    };
    const initSplit = () => {
      var _a;
      const { leftView, rightView, chartTable, paramsTurn, chartBox, tableBox, testTree, leftParams } = ((_a = getCurrentInstance()) == null ? void 0 : _a.refs) || {};
      const options = [
        { el: [leftView, rightView], direction: "horizontal", sizes: [15, 85] },
        { el: [chartTable, paramsTurn], direction: "horizontal", sizes: [70, 30] },
        { el: [chartBox, tableBox], direction: "vertical", sizes: [68, 32], minSize: [0, 100] },
        { el: [testTree, leftParams], direction: "vertical", sizes: [60, 40] }
      ];
      splitList = [];
      options.forEach((x) => {
        const split = Split(x.el, {
          snapOffset: 0,
          gutterSize: 10,
          onDrag: () => {
            var _a2;
            (_a2 = chartViewRef.value) == null ? void 0 : _a2.chartResize();
          },
          onDragEnd: () => {
            console.log("拖动结束");
          },
          ...x
        });
        splitList.push(split);
      });
    };
    const handleOpenTask = async () => {
      var _a, _b;
      console.log("打开任务");
      const taskId = String(testStore.taskId || "");
      const { data } = await openTask(void 0, { taskId });
      console.log("准备获取左侧树结构数据↓");
      (_a = testTreeRef.value) == null ? void 0 : _a.getTreeData();
      console.log("准备获取左侧树结构数据↑");
      (_b = leftParamsRef.value) == null ? void 0 : _b.getData();
      if (data === "[]") return;
    };
    const getCaseReults = async () => {
      chartData.value = [];
      resultLoading.value = true;
      const { data } = await getTestCaseReults({ testCaseId: currentCase.value.id || "" }, { taskId: taskInfo.value.id });
      resultLoading.value = false;
      chartData.value = String(data) === "[]" ? [] : data || [];
      setChartTableData(true);
    };
    const setChartTableData = (reset = true) => {
      nextTick(() => {
        var _a, _b;
        if (caseType.value === 6) {
          chartData.value = reset ? handleGroup(chartData.value) : angleGroup.value[angle.value] || [];
        }
        (_a = chartViewRef.value) == null ? void 0 : _a.drawChart(chartData.value, treeRootName.value);
        (_b = tableViewRef.value) == null ? void 0 : _b.scrollBottom(true);
      });
    };
    const handleGroup = (data) => {
      var _a;
      angleGroup.value = {};
      angleOptions.value = [];
      data.forEach((item) => setDataGroup(item));
      angle.value = ((_a = data[0]) == null ? void 0 : _a.refAngle) || 0;
      return angleGroup.value[angle.value] || [];
    };
    const setDataGroup = (row) => {
      const key = row.refAngle || 0;
      if (angleGroup.value[key]) {
        angleGroup.value[key].push(row);
      } else {
        angleGroup.value[key] = [row];
        angleOptions.value.push({ label: row.refAngle + "°", value: Number(row.refAngle || 0) });
      }
    };
    const getCaseConfig = async () => {
      var _a;
      (_a = paramsBoxRef.value) == null ? void 0 : _a.getConfigData([]);
      const { data } = await getTestCaseConfig({ caseId: currentCase.value.id || "" }, { taskId: taskInfo.value.id });
      nextTick(() => {
        var _a2;
        (_a2 = paramsBoxRef.value) == null ? void 0 : _a2.getConfigData(data || []);
      });
    };
    const clearTestData = () => {
      var _a;
      chartData.value = [];
      (_a = testLog.value) == null ? void 0 : _a.clearTestLog();
      if (caseType.value === 6) {
        angle.value = "";
        angleOptions.value = [];
        angleGroup.value = {};
      }
    };
    return (_ctx, _cache) => {
      resolveComponent("el-option");
      resolveComponent("el-select");
      const _directive_loading = resolveDirective("loading");
      return openBlock(), createElementBlock("div", _hoisted_1, [
        createElementVNode("div", _hoisted_2, [
          createElementVNode("div", _hoisted_3, [
            createVNode(TestTree, {
              ref_key: "testTreeRef",
              ref: testTreeRef,
              current: currentCase.value,
              "onUpdate:current": _cache[0] || (_cache[0] = ($event) => currentCase.value = $event),
              testStatus: testStatus.value,
              "onUpdate:testStatus": _cache[1] || (_cache[1] = ($event) => testStatus.value = $event),
              treeRootName: treeRootName.value,
              "onUpdate:treeRootName": _cache[2] || (_cache[2] = ($event) => treeRootName.value = $event),
              taskId: taskInfo.value.id
            }, null, 8, ["current", "testStatus", "treeRootName", "taskId"])
          ], 512),
          createElementVNode("div", _hoisted_4, [
            createVNode(LeftParams, {
              ref_key: "leftParamsRef",
              ref: leftParamsRef,
              testStatus: testStatus.value
            }, null, 8, ["testStatus"])
          ], 512)
        ], 512),
        createElementVNode("div", _hoisted_5, [
          createElementVNode("div", _hoisted_6, [
            createElementVNode("div", _hoisted_7, toDisplayString(currentCase.value.name), 1),
            createElementVNode("div", _hoisted_8, [
              createElementVNode("div", _hoisted_9, [
                withDirectives(createElementVNode("div", _hoisted_10, [
                  createVNode(ChartView, {
                    ref_key: "chartViewRef",
                    ref: chartViewRef,
                    class: "chart-view",
                    dataLen: chartData.value.length,
                    caseName: currentCase.value.name
                  }, null, 8, ["dataLen", "caseName"]),
                  createCommentVNode("", true)
                ], 512), [
                  [vShow, ![4, 16, 17].includes(caseType.value)]
                ]),
                createElementVNode("div", _hoisted_11, [
                  createElementVNode("div", _hoisted_12, [
                    withDirectives((openBlock(), createElementBlock("div", {
                      class: "tab-ct",
                      style: normalizeStyle(`height: calc(100% - ${[16, 17].includes(caseType.value) ? 12 : 29}px)`)
                    }, [
                      tab.value == 1 ? (openBlock(), createBlock(TableBox, {
                        key: 0,
                        ref_key: "tableViewRef",
                        ref: tableViewRef,
                        caseName: currentCase.value.name,
                        tableList: chartData.value,
                        treeRootName: treeRootName.value,
                        caseType: caseType.value,
                        testStatus: testStatus.value
                      }, null, 8, ["caseName", "tableList", "treeRootName", "caseType", "testStatus"])) : createCommentVNode("", true),
                      tab.value == 2 ? (openBlock(), createBlock(TestLog, {
                        key: 1,
                        ref_key: "testLog",
                        ref: testLog
                      }, null, 512)) : createCommentVNode("", true)
                    ], 4)), [
                      [_directive_loading, resultLoading.value]
                    ]),
                    ![16, 17].includes(caseType.value) ? (openBlock(), createElementBlock("div", _hoisted_13, [
                      (openBlock(), createElementBlock(Fragment, null, renderList(tabList, (item, index) => {
                        return createElementVNode("div", {
                          key: index,
                          class: normalizeClass(["item", { active: item.value == tab.value }]),
                          onClick: ($event) => tab.value = item.value
                        }, toDisplayString(item.name), 11, _hoisted_14);
                      }), 64))
                    ])) : createCommentVNode("", true)
                  ])
                ], 512)
              ], 512),
              createElementVNode("div", _hoisted_15, [
                createVNode(ParamsView, {
                  ref_key: "paramsBoxRef",
                  ref: paramsBoxRef,
                  class: "params-view",
                  caseId: currentCase.value.id
                }, null, 8, ["caseId"])
              ], 512)
            ])
          ])
        ], 512)
      ], 512);
    };
  }
});
const TestForm = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-226ef11b"]]);
const moduleInfo = {
  moudleType: "TestForm",
  name: "测试模块",
  version: "1.0.0",
  description: "测试列表查询"
};
class TestModule {
  constructor(sendCmd, initialData = {}, updateState) {
    __publicField(this, "_moduleInfo", moduleInfo);
    __publicField(this, "_eventData");
    __publicField(this, "sendCmd");
    __publicField(this, "_updateState");
    this._eventData = ref(initialData);
    this.sendCmd = sendCmd;
    this._updateState = updateState;
  }
  sendCommand(cmd, cmdParams) {
    console.log("发送指令：", cmd, cmdParams);
    return this.sendCmd(this._moduleInfo.moudleType, cmd, cmdParams);
  }
  updateState(state) {
    this._updateState(state);
  }
  install(app) {
    app.component("TestForm", TestForm);
    app.provide(GET_TEST_DATA_KEY, () => this.eventData);
    app.provide(SEND_TEST_CMD_KEY, (cmd, cmdParams) => {
      console.log("插件内部转发指令：", cmd, cmdParams);
      return this.sendCommand(cmd, cmdParams);
    });
  }
  get eventData() {
    return this._eventData;
  }
  dataEvent(data) {
    Object.assign(this._eventData, data);
  }
  async startup() {
    var _a, _b;
    const taskStore = useTestStore();
    if (!taskStore.sendTestCmd) {
      console.log("Pinia 中未存储 sendTestCmd,进行存储");
      taskStore.setInjections({
        sendTestCmd: (cmd, cmdParams) => this.sendCommand(cmd, cmdParams),
        updateState: (state) => this.updateState(state)
      });
    }
    console.log("插件根组件获取到 sendTestCmd,初始化成功", taskStore.sendTestCmd);
    taskStore.setInitData({
      taskId: (_b = (_a = this._eventData) == null ? void 0 : _a.value) == null ? void 0 : _b.taskId
    });
    console.log("初始值消息，", taskStore.taskId);
    console.log("存储后 Pinia 中的值：", taskStore.sendTestCmd);
    console.log("测试模块初始化完成");
  }
}
const createTestModule = (sendCmd, initialData, updateState) => {
  return new TestModule(sendCmd, initialData, updateState);
};
export {
  TestForm,
  createTestModule
};
